<?php

function displayListe($collection)
{
  $chaine = '<ul>';

  foreach($collection as $data){
    $chaine .= '<li>'.$data.'</li>';
  }

  $chaine .= '</ul>';

  return $chaine;
}

/**
 *
 * Enter description here ...
 * @param $debut timestamp
 * @param $fin timestamp
 */
function displayRange($debut, $fin)
{
  $chaine = '';

  if(!$debut && !$fin){
    $chaine = 'Pas de période sélectionnée';
  }

  if ($debut && $fin){
    $debut = date('d/m/Y',$debut);
    $fin = date('d/m/Y',$fin);
    $chaine .= 'Du '.$debut.' au '.$fin;
  }
  else{
    if($debut){
      $debut = date('d/m/Y',$debut);
      $chaine .= 'Depuis '.$debut;
    }
    if($fin){
      $fin = date('d/m/Y',$fin);
      $chaine .= 'Jusqu\'au '.$fin;
    }
  }

  return $chaine;
}